Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pcflags tostr refactor #567

Merged
merged 12 commits into from
Nov 18, 2024
Merged

Pcflags tostr refactor #567

merged 12 commits into from
Nov 18, 2024

Conversation

RhoSigma-QB64
Copy link
Member

@RhoSigma-QB64 RhoSigma-QB64 commented Nov 14, 2024

Pre-Compiler Flags

  • _QB64PE_ always true (-1)
  • _ASSERTS_ = 1 if $ASSERTS or $ASSERTS:CONSOLE is used, 0 otherwise
  • _CONSOLE_ = 1 if a console is active either by using $CONSOLE directly or implied by $ASSERTS:CONSOLE, = 2 if $CONSOLE:ONLY is set, 0 if no console is available (both console variants may appear multiple times in a program, the last found one determines the final state)
  • _DEBUG_ = 1 if $DEBUG is used, 0 otherwise
  • _SOCKETS_ = 1 if the program uses _OPENHOST/CLIENT, 0 otherwise (for internal use)
  • _EXPLICIT_ = 1 if the program uses OPTION _EXPLICIT, 0 otherwise (note OE implies _EXPLICITARRAY)
  • _EXPLICITARRAY_ = 1 if the program uses OPTION _EXPLICITARRAY or OPTION _EXPLICIT, 0 otherwise

New function _ToStr$(value[,digits])

  • no leading/trailing space output
  • supports full _FLOAT range and precision up to 19 significant digits, i.e. in scientific notation 1 digit before the period and then 18 decimal places
  • number of desired significant digits as optional argument (ignored by the integer variants of the function)

Additional

  • refactoring auto-includes
  • new state variables system (handling states and recompile options)
  • adapted sources to use the new _ToStr$() function for _FLOAT values (CONST evaluation + $DEBUG variable watch)
  • added some more constants
  • removed/fixed the last remains of $NOPREFIX dependent code (mainly in $DEBUG code)

- ExportAs function moved into ide_export.bas
- renamed file_converters.bas into ide_converters.bas
- made all $INCLUDE lines using backslash
- auto-include manager pulled into GOSUB routine
- precompiler flags pulled into GOSUB routine
- adjusted to _XXX_ syntax
- minor rewording
- shaping the state and recompile handling into a reliable system
- no unneeded leading/trailing space
- working with full _FLOAT range
- optional number of significant digits argument
- use the new _ToStr$() function for _FLOAT values (CONST eval. + $DEBUG variable watch)
- auto-include tests
- function _ToStr$() tests
- precompiler flags tests
- one more change missed in the "Reworking sources" commit
- business as usual
- removed/fixed the last remains of $NOPREFIX dependent code (mainly in $DEBUG code)
- added constants for minimal fraction in each type
@RhoSigma-QB64 RhoSigma-QB64 merged commit 2928d09 into main Nov 18, 2024
4 checks passed
@RhoSigma-QB64 RhoSigma-QB64 deleted the pcflags-tostr-refactor branch November 18, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
const-issues enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

2 participants